/*************************************************************************
    > File Name: p1605.cpp
    > Author: zhangxu
    > Mail: walrus1983@126.com
    > Created Time: 六  8/31 07:19:35 2024
 ************************************************************************/

#include <cstdio>
// #include <iostream>
using namespace std;
#define MAX_N 5

int n, m, t;
int start_x, start_y, end_x, end_y;
int ans = 0;
int g[MAX_N + 5][MAX_N + 5] = {0};
int dir[4][2] = {{-1, 0}, {0, 1},
				 {1, 0},  {0, -1}
			};

void dfs(int x, int y) {
	if(x == end_x && y == end_y) {
		ans += 1;
		return ;
	}
	g[x][y] = 0;
	for(int k = 0; k < 4; k++) {
		int dx = x + dir[k][0];
		int dy = y + dir[k][1];
		if(g[dx][dy] == 0) continue ;
		dfs(dx, dy);
	}
	g[x][y]= 1;
}

int main() {
    scanf("%d%d%d", &n, &m, &t);
	for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            g[i][j] = 1;
        }
    }
	scanf("%d%d%d%d", &start_x, &start_y, &end_x, &end_y);
	for(int i = 0, tx, ty; i < t; i++) {
		scanf("%d%d", &tx, &ty);
		g[tx][ty] = 0;
	}
	dfs(start_x, start_y);
	printf("%d\n", ans);
    return 0;
}